package com.juzi.wopu.service.impl;

import java.util.List;
import java.util.Map;
import com.juzi.wopu.domain.SysRole;
import com.juzi.wopu.service.ISysRoleService;

public class SysRoleServiceImpl extends BaseServiceImpl<SysRole> implements ISysRoleService{

	@Override
	public void getSysRoleMap(Map<Long, SysRole> map1, Map<String, SysRole> map2) {
		List<SysRole> list=BaseDao.getAll(SysRole.class);
		if(list!=null && list.size()>0){
			if(map1!=null && map2==null){
				for(SysRole sysRole:list){
					map1.put(sysRole.getiId(), sysRole);
				}
			}
			else if(map1==null && map2!=null){
				for(SysRole sysRole:list){
					map2.put(sysRole.getsName(), sysRole);
				}
			}
			else if(map1!=null && map2!=null){
				for(SysRole sysRole:list){
					map1.put(sysRole.getiId(), sysRole);
					map2.put(sysRole.getsName(), sysRole);
				}
			}
		}
	}

	@Override
	public List<SysRole> findAllRole() {
		String hql="from SysRole";
		List<SysRole> list=BaseDao.findByhql(hql);
		return list;
	}

}






